
import java.util.Hashtable;
public class File {
  public Hashtable<String,Seeder> seeders;

  public Hashtable<String,Leecher> leechers;

  public String key;

  public long size;

  public long piecesize;

  public File(String key, long size, long piecesize) {
		this.key=key;
		this.size=size;
		this.piecesize=piecesize;
		this.seeders=new Hashtable<String,Seeder>();		
		this.leechers=new Hashtable<String,Leecher>();	
  }

  public Seeder addSeeder(String ip, int port, String filename) {
		Seeder seeder= new Seeder(ip,port,filename);
		return seeders.put(ip.concat(":").concat(String.valueOf(port)),seeder);		
  }

  public Leecher addLeecher(String ip, int port) {
		Leecher leecher=new Leecher(ip,port);
		return leechers.put(ip.concat(":").concat(String.valueOf(port)),leecher);
  }

}
